package _09_heap.test;

import _07_priority_queue.Priority;

/**
 * @author: mornd
 * @dateTime: 2023/6/8 - 15:59
 * 大顶堆实现，大的在顶部
 */
public final class MaxHeap<E extends Priority> extends AbstractPriorityHeap<E> {

    public MaxHeap(int capacity) {
        super(capacity);
    }

    @Override
    protected boolean upwardComparison(Priority son, Priority parent) {
        return son.priority() < parent.priority();
    }

    @Override
    protected boolean downwardComparison(Priority parent, Priority son) {
        return son.priority() > parent.priority();
    }


}
